require(['jquery','token'], function($,token) {
    var search=new Vue({
        el:'.content',
        data:{
            matches:[],
            focus:false,
            keywords:''
        },
        filters:{
        },
        methods:{
            getMatch:function(){
                var address=this.$data.keywords;
                var self=this;
                $.ajax({
                    url:'/api/addressMatched',
                    data:{
                        address:address
                    },
                    method:'get',
                    success:function(data){

                        self.$data.matches=data;
                        self.$data.focus=true;
                    }
                })
            },
            showResult:function(){
                this.getMatch();
            },
            hideResult:function(){
                this.$data.focus=false;
            },
            fillSearchBar:function(address,event){
                console.log(event.currentTarget)
                this.$data.keywords=address;
            },
            search:function(){
                window.location.href='/shopList?address='+this.$data.keywords;
            }
        },
		ready:function(){
			$('.navbar-brand').bind('click',function(){
				$(this).attr({
					target:'_blank',
					href:'/pc/html/ppt.html'
				})
			})
		}
    })
});